package com.wjk.kylin.rpc.core.registry;


import java.util.Set;
import java.util.TreeSet;

/**
 * application registry
 * @author wjk
 */
public interface Register {

    /**
     * start
     * @param registryAddress
     */
    void start(String registryAddress);

    /**
     * start
     */
    void stop();


    /**
     * registry service, for mult
     *
     * @param keys  service key
     * @param value service value/ip:port
     * @return
     */
    boolean registry(Set<String> keys, String value);


    /**
     * remove service, for mult
     *
     * @param keys
     * @param value
     * @return
     */
    boolean remove(Set<String> keys, String value);

    /**
     * discovery services, for mult
     *
     * @param keys
     * @return
     */
    void discovery(Set<String> keys);

    /**
     * discovery service, for one
     *
     * @param key service key
     * @return service value/ip:port
     */
    TreeSet<String> discovery(String key);

}
